/*
 * ElectricPropulsion.h
 *
 *  Created on: Apr 12, 2010
 *      Author: andrew
 */

#ifndef ELECTRICPROPULSION_H_
#define ELECTRICPROPULSION_H_

#include "Propulsion.h"
#include "Motor.h"
#include "Propeller.h"
#include "Atmosphere.h"
#include "Matrix.h"

class ElectricPropulsion: public Propulsion {
	Atmosphere* atm;
	double T, Q;
	double prevV,prevAlt,prevThrottle;
	Matrix *Ttable, *Mtable;
	double Vmin, Vmax;
	int nPtsV, nPtsT;

public:
	ElectricPropulsion(Atmosphere* atm);
	~ElectricPropulsion();

	double getThrust(double V, double alt, double throttle);
	double getTorque(double V, double alt, double throttle);

	void loadTable();
//	void generateTable(double Vmin, double Vmax, int nPts);
	void interpFromTable(double V, double throttle);

private:
//	void compute(double V, double alt, double throttle);
	double interp(double x1, double y1, double x2, double y2, double x);
};

#endif /* ELECTRICPROPULSION_H_ */
